using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ApplicationBlocks.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace DataHelper.DAL
{
    public class webpages_OAuthMembership
    {
private static  string m_trConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

       #region webpages_OAuthMembershipSelectAll
        public static SqlDataReader webpages_OAuthMembershipSelectAll(string strSearch="",int top = 1, int bottom = 20, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "webpages_OAuthMembershipSelectAllRows",strSearch,top,bottom);
            return SqlHelper.ExecuteReader(m_trConnectionString, "webpages_OAuthMembershipSelectAllRows",strSearch,top,bottom);
        }
        #endregion
       #region webpages_OAuthMembershipSelectRow
        public static SqlDataReader webpages_OAuthMembershipSelectRow(string Provider, string ProviderUserId, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "webpages_OAuthMembershipSelectRow", Provider, ProviderUserId);
            return SqlHelper.ExecuteReader(m_trConnectionString, "webpages_OAuthMembershipSelectRow", Provider, ProviderUserId);
        }
        #endregion
       #region webpages_OAuthMembershipInsertRow
        public static void webpages_OAuthMembershipInsertRow(string Provider, string ProviderUserId, int UserId, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "webpages_OAuthMembershipInsertRow", Provider, ProviderUserId, UserId);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "webpages_OAuthMembershipInsertRow", Provider, ProviderUserId, UserId);
        }
        #endregion
       #region webpages_OAuthMembershipUpdateRow
        public static void webpages_OAuthMembershipUpdateRow(string Provider, string ProviderUserId, int UserId, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "webpages_OAuthMembershipUpdateRow", Provider, ProviderUserId, UserId);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "webpages_OAuthMembershipUpdateRow", Provider, ProviderUserId, UserId);
        }
        #endregion
       #region webpages_OAuthMembershipDeleteRow
        public static void webpages_OAuthMembershipDeleteRow(string Provider, string ProviderUserId, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "webpages_OAuthMembershipDeleteRow", Provider, ProviderUserId);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "webpages_OAuthMembershipDeleteRow", Provider, ProviderUserId);
        }
        #endregion

    }
}

